<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
	<title>Vuejs动画和velocity.js库</title>
	<script type="text/javascript" src="./vue.js"></script>
</head>
<body>	
	<div id="app">
		<transition 
			@before-enter="handleBeforeEnter"
			@enter="handleEnter"
			@after-enter="handleAfterEnter"
		>
			<div v-if="show">hello world</div>
		</transition>
		<button @click="handleClick">goggle</button>
	</div>
	<script>
		var app = new Vue({
			el : '#app' ,
			data : {
				show : true
			},
			methods : {
				handleClick : function() {
					this.show = !this.show;
				},
				handleBeforeEnter : function(el) {
					el.style.color = "red"
				},
				handleEnter : function(el ,done) {
					setTimeout(() => {
						el.style.color="green"
					} , 2000);
					setTimeout(() => {
						done()
					} , 4000);
					
				},
				handleAfterEnter : function(el) {
					el.style.color = "black"
				}
			}
		});
	</script>
</body>
</html>